package client_logic;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import client_gui.ClientGui;
import client_gui.EmployeeLogInGUI;

public class CcrmClient {
	/**
	 * @class CcrmClient contains main for system.
	 * 
	 * @param ClientGui for server-client interface.
	 * @param CcrmCon for server-client interface.
	 * @param EmployeeLogInGUI links to check fields for employee authorization.
	 */

	public static ClientGui cg;
	public static CcrmCon inet;
	private static EmployeeLogInGUI login;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		cg = new ClientGui();
		cg.setSize(400, 400);
		cg.setVisible(true);
		
		cg.btnConnect.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				try {
					inet=new CcrmCon (cg.getIp(),cg.getPort());
					System.out.println("connected to server");
					cg.dispose();
					login = new EmployeeLogInGUI ();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					System.out.println("could not connect to server");
				}
			}
		});
		
		

	}

}
